package ro.ubbcluj.cs.damate.persistence.repository;

import org.springframework.data.repository.CrudRepository;
import ro.ubbcluj.cs.damate.persistence.entities.Token;
import ro.ubbcluj.cs.damate.persistence.entities.User;

import java.sql.Timestamp;
import java.util.List;

/**
 * @author Lóránd Fazakas (lorand)
 *         Date: 6/26/13
 *         Time: 0:10 PM
 */
public interface TokenRepository extends CrudRepository<Token, Long> {

    List<Token> findByToken(String token);
    List<Token> findByUserAndExpirationGreaterThan(User user, Timestamp now);
}
